package com.socket.socketObjTest;

import java.io.*;
import java.net.Socket;

/**
 * LoginClient--bdqnPractice
 *
 * @author: Jovi
 * @createTime: 2017-09-06 16:14
 **/
public class LoginClient {

    public static void main(String[] args) {
        try {
            Socket socket = new Socket("localhost", 8800);
            OutputStream os = socket.getOutputStream();
            ObjectOutputStream oos = new ObjectOutputStream(os);

            User u = new User();
            u.setId(1);
            u.setName("jam");
            oos.writeObject(u);

            oos.close();
            os.close();
            socket.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
